import React, { Component } from "react";
import { Container } from "./style";
import { NavLink } from "react-router-dom";
import logo from "../../assets/image/logo.gif";
class index extends Component {
  state = {
    menuNum: 1,
  };

  setMenuNum = (num) => {
    this.setState({ menuNum: num });
  };

  render() {
    return (
      <Container>
        <>
          <div className="topNav">
            <div className="topNav_l">
              <img src={logo} alt="" />
              <span>易耗品管理</span>
            </div>
            <ul className="topNav_r">
              <li
                className={this.state.menuNum === 1 ? "active " : ""}
                onClick={() => this.setMenuNum(1)}
              >
                <NavLink to="/home">首页</NavLink>
              </li>
              <li
                className={this.state.menuNum === 2 ? "active " : ""}
                onClick={() => this.setMenuNum(2)}
              >
                <NavLink to="/apply">
                  物品申领
                </NavLink>
              </li>
              <li
                className={this.state.menuNum === 3 ? "active " : ""}
                onClick={() => this.setMenuNum(3)}
              >
                <NavLink to="/approval">
                  审批
                </NavLink>
              </li>
              <li
                className={this.state.menuNum === 4 ? "active " : ""}
                onClick={() => this.setMenuNum(4)}
              >
                <NavLink to="/management">
                易耗品管理
                </NavLink>
              </li>
              <li
                className={this.state.menuNum === 5 ? "active " : ""}
                onClick={() => this.setMenuNum(5)}
              >
                <NavLink to="/basicSetting">
                基础设施
                </NavLink>
              </li>
            </ul>
          </div>
                  
          {/* <Switch>
                      
            <Route path="/" component={Home} />
                      
                    
          </Switch> */}
                
        </>
      </Container>
    );
  }
}

export default index;
